﻿<Window x:Class="Commands.MonitorCommands"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MonitorCommands" Height="300" Width="339.2"
        xmlns:local="clr-namespace:Commands" Unloaded="window_Unloaded"
    >
  <Window.CommandBindings>

    <CommandBinding Command="local:MonitorCommands.ApplicationUndo"
                    Executed="ApplicationUndoCommand_Executed"
                    CanExecute="ApplicationUndoCommand_CanExecute"></CommandBinding>
  </Window.CommandBindings>
  
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"></RowDefinition>
      <RowDefinition></RowDefinition>
      <RowDefinition></RowDefinition>
      <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>


    <ToolBarTray  Grid.Row="0">
      <ToolBar>
        <Button Command="ApplicationCommands.Cut">Cut</Button>
        <Button Command="ApplicationCommands.Copy">Copy</Button>
        <Button Command="ApplicationCommands.Paste">Paste</Button>
        <Button Command="ApplicationCommands.Undo">Undo</Button>
      </ToolBar>
      <ToolBar>
        <Button Command="local:MonitorCommands.ApplicationUndo">Reverse Last Command</Button>
      </ToolBar>
    </ToolBarTray>
    <TextBox Margin="5" Grid.Row="1"
             TextWrapping="Wrap" AcceptsReturn="True">     
    </TextBox>
    <TextBox Margin="5" Grid.Row="2"
             TextWrapping="Wrap" AcceptsReturn="True">
    </TextBox>


    <ListBox Grid.Row="3" Name="lstHistory" Margin="5" DisplayMemberPath="CommandName"></ListBox>
  </Grid>
</Window>
